function reactive(target, type) {
  return new Proxy(target, {
      get(obj, prop, receiver) {
          console.log(`Getting ${prop}: ${obj[prop]}; ${type}`);
          return Reflect.get(obj, prop, receiver);
      },
      set(obj, prop, value, receiver) {
          console.log(`Setting ${prop} to ${value}; ${type}`);
          return Reflect.set(obj, prop, value, receiver); // 修正这里
      }
  });
}

// 创建两个响应式对象
const counter = reactive({ num: 0 }, 1);
const parentCounter = reactive({ num: 2, wsj: 123 }, 2);

// 设置 counter 的原型为 parentCounter
Object.setPrototypeOf(counter, parentCounter);

// 测试代码
counter.wsj // 访问 counter.wsj

// 输出
// Getting wsj: 123; 2
// proxy深度.js:4
// Getting wsj: 123; 1
// proxy深度.js:4
// Getting wsj: 123; 2